<div class="codingd">
    <div class="m-subheader">
      <div class="row align-items-center">
        <div class="mr-auto col-auto">
          <h3 class="m-subheader__title m-subheader__title--separator">
            <span>编码规则</span>
          </h3>
        </div>
      </div>
    </div>
    <div class="m-content">
      <div class="m-portlet m-portlet--mobile">
        <div class="m-portlet__body">
            <div class="p-formgroup-inline">
                <span class="p-field">
                    <span class="input-lable" style="margin-right: 20px;">编码名称：</span>
                    <input style="line-height: 24px!important;" id="input" type="text" size="30" pInputText [(ngModel)]="codeName"> 
                </span>
                <!-- <span class="p-field">
                    <span class="ml input-lable" style="margin-right: 20px;">功能模块：</span>
                    <p-dropdown name="functionModule" [options]="functionOptions" [(ngModel)]="functionModule" placeholder="请选择型号"  emptyFilterMessage="暂无数据">
                        <ng-template let-item pTemplate="selectedItem">
                            <span *ngIf="functionModule != undefind "  style="vertical-align:middle; margin-left: .5em;width: 200px;">{{item.label}}</span>
                            <span *ngIf="functionModule == undefind " style="vertical-align:middle; margin-left: .5em;width: 200px;"> </span>
                        </ng-template>
                        <ng-template let-model pTemplate="item">
                            <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                <div style="font-size:14px;float:right;margin-top:4px;width: 200px;">{{model.label}}</div>
                            </div>
                        </ng-template>
                    </p-dropdown>
                </span> -->
                <span class="p-field">
                    <span class="ml input-lable" style="margin-right: 20px;">状态：</span>
                    <p-dropdown name="isUsed" [options]="isUsedOptions" [(ngModel)]="isUsed" placeholder="请选择状态"  emptyFilterMessage="暂无数据">
                        <ng-template let-item pTemplate="selectedItem">
                            <span *ngIf="isUsed != undefind "  style="vertical-align:middle; margin-left: .5em;width: 200px;">{{item.label}}</span>
                            <span *ngIf="isUsed == undefind " style="vertical-align:middle; margin-left: .5em;width: 200px;"> </span>
                        </ng-template>
                        <ng-template let-model pTemplate="item">
                            <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                <div style="font-size:14px;float:right;margin-top:4px;width: 200px;">{{model.label}}</div>
                            </div>
                        </ng-template>
                    </p-dropdown>
                </span>
                <p-button label="查询" (onClick)="getTableList()" class="ml"></p-button>
                <p-button label="重置" (onClick)="reset()" class="ml"></p-button>
            </div>
            <div style="margin-top: 30px;">
                <p-button *ngIf="'Pages.CodingRules.newlyAdded' | permission" label="新增" (onClick)="addOrUpdate()" ></p-button>
                <p-button *ngIf="'Pages.CodingRules.Enable' | permission" label="启用" (onClick)="enable(true)" class="ml"></p-button>
                <button *ngIf="'Pages.CodingRules.Deactivate' | permission" pButton class="ui-button-warning ml" type="button" label="停用" (click)="enable(false)" ></button>
                <p-button *ngIf="'Pages.CodingRules.Delete' | permission" label="删除" (onClick)="delete()" class="ml"></p-button>
            </div>
           <div class="row align-items-center" style="margin-top: 25px;">
            <div class="primeng-datatable-container">
              <p-table #dataTable [value]="primengTableHelper.records" (onLazyLoad)="getTableList($event)"
                rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true"
                [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                [resizableColumns]="primengTableHelper.resizableColumns" 
                [(selection)]="selectRow">
                <ng-template pTemplate="header" selectionMode="multiple">
                  <tr>
                    <th style="width: 50px">
                        <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
                    </th>
                    <th style="width: 100px">操作</th>
                    <th style="width: 150px">编码名称</th>
                    <!-- <th style="width: 150px">功能模块</th> -->
                    <th style="width: 150px">系统规则</th>
                    <th style="width: 150px">状态</th>
                    <th style="width: 150px">作用模块</th>
                    <th style="width: 150px">备注</th>
                    <th style="width: 150px">更新人</th>
                    <th style="width: 150px">更新时间</th>
                  </tr>
                </ng-template>
                <ng-template pTemplate="body" let-record="$implicit" let-rowIndex="rowIndex">
                  <tr>
                    <td style="width: 50px">
                        <p-tableCheckbox [value]="record"></p-tableCheckbox>
                    </td>
                    <td style="width: 100px">
                      <div class="btn-group dropdown" dropdown container="body">
                        <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                          <i class="fa fa-cog"></i><span class="caret"></span> 操作
                        </button>
                        <ul class="dropdown-menu" *dropdownMenu>
                            <li>
                                <a *ngIf="'Pages.CodingRules.Resume' | permission" href="javascript:;" (click)="look(record)">履历</a>
                              </li>
                          <li>
                            <a *ngIf="'Pages.CodingRules.Modify' | permission" href="javascript:;" (click)="addOrUpdate(record)">修改</a>
                          </li>
                        </ul>
                      </div>
                    </td>
                    <td style="width: 150px">{{record.codeName}}</td>
                    <td style="width: 150px">{{record.sysRules}}</td>
                    <!-- <td style="width: 150px">{{record.system}}</td> -->
                    <td style="width: 150px">{{record.isUsed == 1? '启用':'停用'}}</td>
                    <td style="width: 150px">{{record.availableModules}}</td>
                    <td style="width: 150px">{{record.remark}}</td>
                    <td style="width: 150px">{{record.userName}}</td>
                    <td style="width: 150px">{{record.lastModificationTime | momentFormat:'YYYY-MM-DD HH:mm:ss'}}</td>
                  </tr>
                </ng-template>
              </p-table>
              <div class="primeng-paging-container">
                <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                  (onPageChange)="getTableList($event)" [totalRecords]="primengTableHelper.totalRecordsCount"
                  [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
                </p-paginator>
                <span class="total-records-count">
                  {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                </span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 新增修改 -->
    <codingEditOrAdd #codingEditOrAdd [editData]="rowdata" [title]="title" (modalSave)="getTableList()"></codingEditOrAdd>
    <!-- 查看履历 -->
    <app-show-resume #showResume [parentInfo]="rowdata"></app-show-resume>
  </div>